package com.tjjingpan.learnkotlin.GenericType

open class Person(val name:String,val age:Int)
class Student(name:String,age: Int) :Person(name,age)
class Teacher(name:String,age:Int) :Person(name,age)

class SimpelData<out T>(val data:T?){
    fun get():T?{
        return data
    }
}


fun main(){
    val student = Student("Tom",19)
    val data = SimpelData<Student>(student)
    handleSimpleData(data)
    val studentData = data.get()


}
fun handleSimpleData(data:SimpelData<Person>){
    val personData = data.get()
}